/**************************************************
Class Name: Entry
Author's Name: John Lawniczak
Date: 04-21-2010
Description of the class: Stores data for an entry
 	containing a name, address, and phone number
***************************************/

public class Entry {
	
	//**************************************//	
	//			Fields						//
	//**************************************//		
	private String name="", address="", telephoneNumber="";
	
	/**************************************************
	Method Name: Entry
	Input to the method: String input
	Output(Return value): None
	Brief description of the task: splits the input 
		string into three parts name, address and 
		phone number
	Author: John Lawniczak
	**************************************************/
	public Entry(String input)
	{	
		String[] splitInput = input.split(":");
		
		name=splitInput[0];
		address=splitInput[1];
		telephoneNumber=splitInput[2];
	}

	/**************************************************
	Method Name: getName
	Input to the method: None
	Output(Return value): String name
	Brief description of the task: gets the name of the entry
	Author: John Lawniczak
	**************************************************/	
	public String getName()
	{
		return name;
	}
	
	/**************************************************
	Method Name:getAddress
	Input to the method: none
	Output(Return value): string address
	Brief description of the task: get the address of the entry
	Author: John Lawniczak
	**************************************************/
	public String getAddress()
	{
		return address;
	}
	
	/**************************************************
	Method Name:getPhoneNumber
	Input to the method:none
	Output(Return value): String phone number
	Brief description of the task:gets the phone number of the entry
	Author: John Lawniczak
	**************************************************/
	public String getPhoneNumber()
	{
		return telephoneNumber;
	}
	
	/**************************************************
	Method Name: setName
	Input to the method: String name to set
	Output(Return value): None
	Brief description of the task: sets the name of the entry
	Author: John Lawniczak
	**************************************************/		
	public void setName(String n){
		name=n;
	}

	/**************************************************
	Method Name: setAddress
	Input to the method: String address
	Output(Return value): None
	Brief description of the task: sets the Address of the entry
	Author: John Lawniczak
	**************************************************/
	public void setAddress(String a){
		address=a;
	}
	
	/**************************************************
	Method Name:setPhoneNumber
	Input to the method: String phone number
	Output(Return value): none
	Brief description of the task:sets the phone number of the entry
	Author: John Lawniczak
	**************************************************/
	public void setPhoneNumber(String p){
		telephoneNumber=p;
	}
	
	/**************************************************
	Method Name:toString
	Input to the method:none
	Output(Return value): String output
	Brief description of the task:creates a string with 
		the entry's name, address and phone number
	Author: John Lawniczak
	**************************************************/
	public String toString(){
		return (name + ",\t" + address + ",\t" + telephoneNumber);
	}
}